#!/bin/bash

# ----------------------------------------------------------------------
# Filename:   75566-rpm-Va.sh
# Version:    1.0
# Date:       2013/12/03
# Author:     yuanhui.shi
# Email:      yuanhui.shi@cs2c.com.cn
# Summary:    02系统基本功能-07开发环境-02开发工具-02rpm构建工具-10查看损坏文件
# Notes:      rpm命令
# Copyright:  China Standard Software Co., Ltd.
# History：     
#             Version 1.0, 2013/12/03
#             -   The first one
# ----------------------------------------------------------------------

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

source ../../lib/Echo.sh

source ../../lib/XmlParse.sh


function CleanData ()
{
  [ -f /usr/bin/c89.$$ ] && mv /usr/bin/c89.$$ /usr/bin/c89
  rpm -Va gcc
  EchoResult "restore gcc"
  EchoInfo "75566-rpm-Va.sh执行完毕"
}

trap "CleanData" EXIT INT

#查看损坏文件
EchoInfo "查询关于软件包gcc的损坏情况"
rpm -Va gcc
EchoResult "软件包gcc没有损坏"

#把软件包gcc的部分文件删除，再次查看gcc损坏情况
EchoInfo "把软件包gcc的部分文件删除，再次查看gcc损坏情况"
mv /usr/bin/c89 /usr/bin/c89.$$
! rpm -Va gcc
EchoResult "软件包gcc损坏了"
